﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/**
 * 创建时间：2014/9/23 15:15:07
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace SurfaceAd.Entities
{
    internal sealed class NetworkInfo
    {
        /// <summary>
        /// 网卡ID
        /// </summary>
        public string NetcardId { get; set; }
        public double NetInboundMaxBitsPerSecond { get; set; }

        public double NetOutboundMaxBitsPerSecond { get; set; }

        public NetAdapterInterfaceType NetAdapterType { get; set; }

        public Boolean IsConnectedToInternet { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("NetworkInfo");
            //            
            sb.Append("NetcardId=").Append("\t").AppendLine(NetcardId);
            sb.Append("NetInboundMaxBitsPerSecond=").Append("\t").AppendLine(NetInboundMaxBitsPerSecond.ToString());
            sb.Append("NetOutboundMaxBitsPerSecond=").Append("\t").AppendLine(NetOutboundMaxBitsPerSecond.ToString());
            if (NetAdapterType != null)
            {
                sb.Append("NetAdapterType.Id=").Append("\t").AppendLine(NetAdapterType.Id.ToString());
                sb.Append("NetAdapterType.Name=").Append("\t").AppendLine(NetAdapterType.Name);
            }
            sb.Append("IsConnectedToInternet=").Append("\t").AppendLine(this.IsConnectedToInternet.ToString());
            return sb.ToString();
        }
    }

    internal sealed class NetAdapterInterfaceType
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}
